<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">

<head>
    <meta charset="UTF-8">
    <title>项目基本信息</title>
    <link rel="stylesheet" href="../style/bootstrap.min.css"/>
    <script type="text/javascript" src="../scripts/jquery.js"></script>
    <script type="text/javascript" src="../scripts/bootstrap.min.js"></script>
    <script>
        function selectChange() {
            var chkSelectAll = document.getElementById("checkAll");
            var checked = chkSelectAll.checked;
            if (checked) {
                // select all products
                selectAllItem();
            } else {
                //unselect all products
                unSelectAll();
            }
        }

        //选择全部
        function selectAllItem() {
            var items = document.getElementsByName("id");
            for (var i = 0; i < items.length; i++) {
                items[i].checked = true;
            }
        }

        //取消全选
        function unSelectAll() {
            var items = document.getElementsByName("id");
            for (var i = 0; i < items.length; i++) {
                items[i].checked = false;
            }
        }

    </script>
    <script>
        function bj() {
            var ids = document.getElementsByName("id");
            var id = 0;
            for (var i = 0; i < ids.length; i++) {
                if (ids[i].checked) {
                    id = ids[i].value;
                }
            }
            window.location.href="/Projects/liItemIndex?id="+id;
        }
        function pro() {
            var ids = document.getElementsByName("id");
            var id = 0;
            for (var i = 0; i < ids.length; i++) {
                if (ids[i].checked) {
                    id = ids[i].value;
                }
            }
            window.location.href="/Projects/itemPro?id="+id;
        }
        function zz() {
            if(confirm("是否确定终止项目！")){
                var ids = document.getElementsByName("id");
                var id = 0;
                for (var i = 0; i < ids.length; i++) {
                    if (ids[i].checked) {
                        id = ids[i].value;
                    }
                }
                window.location.href="/Projects/zzItem?id="+id;
            }

        }

    </script>
</head>

<body>
<div class="container">
    <!--
    <div class="row">
        <form action="" method="post">
            <table class="unit-the-table table">
                <tr>
                    <th colspan="5">查询条件</th>
                </tr>
                <tr>
                    <td>项目编号：<input type="text"></td>
                    <td>项目名称：<input type="text"></td>
                    <td>创建人：
                        <select>
                            <option>111</option>
                        </select>
                    </td>
                    <td>项目类型：
                        <select>
                            <option>111</option>
                        </select>
                    </td>
                    <td>项目状态：
                        <select>
                            <option>111</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td></td>
                    <td><input class="btn-primary" type="button" value="查询"/>
                        <input class="btn-primary" type="reset" value="重置"/></td>
                    <td colspan="3"></td>
                </tr>
            </table>
        </form>
    </div>
    -->
    <div class="row">
        <div class="col-xs-6">

            <h3>查看项目信息</h3>

        </div>
        <div class="caption col-xs-6 text-right">
            <input class="btn-primary" onclick="bj()" type="button" value="编辑">
            <input class="btn-danger" onclick="zz()" type="button" value="终止">
            <input class="btn-success" onclick="pro()" type="button" value="提交审核">
            <input class="btn-toolbar" onclick="pro()" type="button" value="查看详情">
            <input class="btn-warning" type="button" value="项目进度">
        </div>

        </table>
    </div>
    <div style="height: 400px;">
        <table class="table table-striped table-hover table-condensed">
            <tr>
                <th><input type="checkbox" id="checkAll" onclick="selectChange()"></th>
                <th>项目名称</th>
                <th>审计部门</th>
                <th>项目类型</th>
                <th>项目状态</th>
                <th>主审</th>
                <th>项目进度</th>
            </tr>
            <tr th:each="ps:${p}">
                <td><input type="checkbox" th:value="${ps.project.id}" name="id"></td>
                <td th:text="${ps.project.name}">项目名称</td>
                <td th:text="${ps.auditInstitution.auditname}">审计部门</td>
                <td>
                    <span th:if="${ps.project.type==1}">公司类</span>
                    <span th:if="${ps.project.type==2}">营业类</span>
                </td>
                <td>
                    <span th:if="${ps.project.status==0}">已终止</span>
                    <span th:if="${ps.project.status==1}">编辑中</span>
                    <span th:if="${ps.project.status==2}">审核中</span>
                    <span th:if="${ps.project.status==3}">已审核</span>
                    <span th:if="${ps.project.status==4}">审核已通过</span>
                </td>
                <td th:text="${ps.user.name}">主审</td>
                <td th:text="${ps.project.progress}">项目进度</td>
            </tr>
        </table>
    </div>
    <div class="table_down-nav">
        <div class="page">
            <form action="#" method="post" name="">
                <a href="#"><i class="glyphicon glyphicon-step-backward"></i></a>
                <a href="#"><i class="glyphicon glyphicon-chevron-left"></i></a> 第
                <input type="text" name=""/> 页， 共 <span name=></span> 页
                <a href="#"><i class="glyphicon glyphicon-chevron-right"></i></a>
                <a href="#"><i class="glyphicon glyphicon-step-forward"></i></a>
            </form>
        </div>
    </div>

</div>
</body>

</html>